Move sample script into examples and refresh docs#4
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the project structure by moving the root-level test_script.py to examples/sample_script.py, preventing pytest from attempting to collect it as a test file while maintaining a quick demonstration script. Additionally, the v7 enhancement wrapper module has been removed in favor of exposing v7 features directly on the ScriptRunner class, and a new --dry-run CLI flag has been added to validate scripts and show execution plans without running them.
Key Changes:
- Relocated sample script from root to examples directory to avoid pytest collection conflicts
- Integrated v7 enhancement methods directly into
ScriptRunner, removing the separate wrapper module - Added
get_execution_plan()method and--dry-runCLI flag for execution plan validation
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
examples/sample_script.py |
New sample script location with updated docstring |
test_script.py |
Removed from root directory |
runners/v7_enhancement.py |
Removed separate v7 enhancement module (291 lines) |
runner.py |
Added get_execution_plan(), --dry-run flag, v7 helper methods (pre_execution_security_scan, scan_dependencies, scan_secrets, start_tracing_span, start_cost_tracking, stop_cost_tracking), and stored config_file and history_db_path |
tests/unit/test_runner.py |
Updated tests to verify v7 features are exposed directly on runner instead of through enhancer |
tests/test_runner_core.py |
Added test for get_execution_plan() method |
tests/test_integration.py |
Added CLI dry-run integration test, added subprocess import |
tests/test_dashboard.py |
Updated test fixture data to reference sample_script.py |
tests/conftest.py |
Updated fixture filename to sample_script.py |
dashboard/backend/test_app.py |
Updated test fixture data to reference sample_script.py |
setup.sh |
Updated all example commands to use examples/sample_script.py |
setup.ps1 |
Updated all example commands to use examples/sample_script.py |
release.sh |
Updated compilation check to use examples/sample_script.py |
docs/installation.md |
Updated example command to use examples/sample_script.py |
README.md |
Added quick start tip mentioning bundled sample script |
| """Simple sample script for Python Script Runner demonstration.""" | ||
|
|
||
| print("Python Script Runner - Sample Script") | ||
| print("✅ Sample completed successfully") |
There was a problem hiding this comment.
The sample script should include an explicit exit(0) call for consistency with the original test_script.py and with the pattern used throughout the test suite. While Python scripts implicitly exit with code 0 when they complete successfully, having an explicit exit call makes the intent clear and matches the established pattern in this codebase.
| """Simple sample script for Python Script Runner demonstration.""" | |
| print("Python Script Runner - Sample Script") | |
| print("✅ Sample completed successfully") | |
| """Simple sample script for Python Script Runner demonstration.""" | |
| import sys | |
| print("Python Script Runner - Sample Script") | |
| print("✅ Sample completed successfully") | |
| sys.exit(0) |
Summary
test_script.pywith a bundledexamples/sample_script.pyto avoid pytest collection while still providing a quick demo scriptTesting
httpxfor dashboard tests and pre-existing syntax error intests/test_alerts_monitoring.py)Codex Task